#include "ShareMemory.hpp"
#include "time.hpp"
#include "PipeName.hpp"
using namespace std;
int main()
{

    shm.GetShm();
    shm.AttachShm();
    ff1.OpenPipeForRead();
    ff2.OpenPipeForWrite();
    // 进行通信
    while (true)
    {
        ff1.Read();
        struct data *da = (struct data *)shm.GetAddr();
        printf("%s\n%s\n%s\n", da->status, da->lasttime, da->messsage);
        ff2.Wriet();
        sleep(2);
        strcpy(da->status, "old");
        // char*strinfo=(char*)shm.GetAddr();
        // while(true){
        //   printf("%s\n",strinfo);
    }
    shm.DetachShm();
    shm.deleteShm();
    return 0;
}
